﻿Public Class RproformaDscto

    Public Shared Function Añadir(ByVal descEmpresa As String, ByVal pProformaDscto As EproformaDscto) As Boolean
        Dim resultado As Boolean = False

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                resultado = DproformaDscto.Añadir(descEmpresa, pProformaDscto)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return resultado
    End Function
    Public Shared Function Filtrar(ByVal descEmpresa As String, ByVal pProforma As EproformaCabecera) As List(Of EproformaDscto)
        Dim proformaDsctos As List(Of EproformaDscto) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                proformaDsctos = DproformaDscto.Filtrar(descEmpresa, pProforma)
                If proformaDsctos Is Nothing Then proformaDsctos = New List(Of EproformaDscto)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return proformaDsctos
    End Function

End Class
